package com.englisheveryday.consants;

/**
 * <pre>
 *    
 * </pre>
 * @author 马永华
 * @date 2012-9-16 下午12:16:05
 * @version 1.1
 */

public class SQLConstants {

	//article
	public static final String sync_article = "select id, englishtext,explaintext,title,category,audio,createtime from article where id in ";
	public static final String save_article = "insert into article(id,englishtext,title,explaintext,category,audio,createtime) values(?,?,?,?,?,?,?)";
	public static final String changelist_article = "select id,dataid,type from changelist_article where anchor > ? and anchor <=?";
	public static final String changelist_article_save = "insert into changelist_article(id,dataid,type,anchor) values(?,?,?,?)";
	public static final String delete_article = "delete from article where id = ?";
	public static final String update_article = "update article set englishtext=?,title=?,explaintext=?,category=?,audio=? where id=?"; 
	public static final String query_article = "select * from article order by createtime desc limit ?,?";
	public static final String get_article = "select * from article where id = ?";
	
	//category
	public static final String sync_category = "select id,name from category where id in ";
	public static final String save_category = "insert into category(id,name) values(?,?)";
	public static final String changelist_category = "select id,dataid,type from changelist_category where anchor > ? and anchor <=?";
	public static final String changelist_category_save = "insert into changelist_category(id,dataid,type,anchor) values(?,?,?,?)";
	public static final String delete_category = "delete from category where id = ?";
	public static final String update_category = "update category set name = ? where id = ?";
	public static final String query_category = "select * from category limit ?,?";
	public static final String get_category = "select * from category where id = ?";
	
	//FeedBack
	public static final String save_feedback = "insert into feedback(id,content,createtime) values(?,?,?)";
	public static final String query_feedback = "select * from feedback order by createtime desc limit ?,?";
	public static final String delete_feedback = "delete from feedback where id = ?"; 
	//update
	public static final String save_systemupdate = "insert into systemupdate(id,nowversion,url,createtime) values(?,?,?,?)";
	public static final String get_systemupdate = "select url,nowversion from systemupdate where nowversion = (select max(nowversion) from systemupdate)";
	public static final String delete_systemupdate = "delete from systemupdate where id = ?";
	public static final String query_systemupdate = "select * from systemupdate order by createtime desc limit ?,?";
}

